/**
 * @Author:  renyc
 * @Date: 2022年12月20日17:23:01
 */

import * as Cesium from "cesium/Cesium";
import Transformer from "../../utils/Transformer";
import EntityOverlay from "./EntityOverlay";
import LayerType from "../../layer/LayerType";

class Polyline extends EntityOverlay{
    constructor(coordinates, options){
        super();       
        this._coordiates = coordinates;
        this._options = options;
        this._delegate = undefined;

        if(coordinates){
            this._delegate = new Cesium.Entity({
                polyline : {
                    positions: Cesium.Cartesian3.fromDegreesArrayHeights(coordinates),
                    ...options
                }
            })
        };
        

        // this._delegate = new Cesium.Entity({
        //     name : "dfffsfs",
        //     polyline : {
        //         positions: Cesium.Cartesian3.fromDegreesArray([117.2, 31.6, 120.6, 32]),
        //         width: 5,
        //         material: Cesium.Color.RED,
        //         clampToGround: true,
        //     }
        // });

        // this._position = position;
        // if(this._position){
        //     this._delegate.position = Transformer.transformWGS84ToCartesian(this._position);
        // }
    }  
    
}

export default Polyline